<template>
	<scroll-view scroll-y="true" style="height: 85.8vh;width:99vw;">
		<view style="padding: 30rpx;">
			<u-search placeholder="搜索" v-model="keywords" shape="square" :showAction="false"
			  bg-color="#f0f0f0" @change="search"></u-search>
		</view>
		<view class="templete">
			<text>最近使用</text>
			<view class="grid">
				<view class="card" @click="toWrite(1,'日报')">
					<view class="card-item card-add">
						<uni-icons type="plusempty" size="30" color="#d0d0d0"></uni-icons>
						<text style="color: #909399;margin-top: 20rpx;font-size: 26rpx;">日志</text>
					</view>
				</view>
				<!-- <view class="card" @click="toWrite(1,'日报')">
					<view class="card-item card-templete">
						<view class="title">日报</view>
						<view class="content">
							<view>今日完成工作</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>未完成工作</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>需协调工作</view>
							<view class="input-tip">请输入</view>
						</view>
					</view>
				</view> -->
				<view class="card" @click="toWrite(2,'周报')">
					<view class="card-item card-templete">
						<view class="title">周报</view>
						<view class="content">
							<view>本周完成工作</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>本周工作总结</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>下周工作计划</view>
							<view class="input-tip">请输入</view>
						</view>
					</view>
				</view>
				<view class="card" @click="toWrite(3,'月报')">
					<view class="card-item card-templete">
						<view class="title">月报</view>
						<view class="content">
							<view>本月工作内容</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>本月工作总结</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>下月工作计划</view>
							<view class="input-tip">请输入</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="templete">
			<text>我的团队</text>
			<view class="grid">
				<view class="card" @click="toWrite(1,'日报')">
					<view class="card-item card-templete">
						<view class="title">日报</view>
						<view class="content">
							<view>今日完成工作</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>未完成工作</view>
							<view class="input-tip">请输入</view>
						</view>
						<view class="content">
							<view>需协调工作</view>
							<view class="input-tip">请输入</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="templete">
			<text>其他</text>
			<view class="grid">
				<view class="card">
					<view class="card-item card-templete">
						<view class="title">其他模板</view>
						<view class="content">
							<view>无</view>
						</view>
					</view>
				</view>
			</view>
		</view> -->
	</scroll-view>
</template>

<script>
	var _this;
	export default {
		name:'WriteLog',
		props:{
			userInfo:Object
		},
		data() {
			return {
				//topHeight: 0,
				keywords:'',
			}
		},
		created(){
			_this = this;
			//let app = uni.getSystemInfoSync();
			//_this.topHeight = app.statusBarHeight;
		},
		methods: {
			search() {
				
			},
			toWrite(type,name) {
				//console.log("123")
				uni.navigateTo({
					url:'/components/worklog/writeTemplete',
					success: function (res) {
					  setTimeout(() => {
						res.eventChannel.emit('writeParams', {templete:{id:type,name:name}});
					  }, 100);
					},
					fail() {
					 
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		padding-bottom: 50rpx;
		overflow: hidden;
	}
	.templete {
		padding: 0 30rpx;
		.grid {
			display: flex;
			flex-wrap: wrap;
			padding: 30rpx 0;
			.card {
				width: 33%;
				padding-bottom: 50%;
				position: relative;
				.card-item {
					position: absolute;
					top: 0;
					left: 0;
					bottom: 0;
					right: 0;
					border: 1px solid #f0f0f0;
					border-radius: 5rpx;
					box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.1);
					margin: 0 20rpx 20rpx 0;
				}
				.card-add {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
				}
				.card-templete {
					padding: 30rpx 20rpx;
					font-size: 18rpx;
					color: #909399;
					.title {
						font-size: 28rpx;
						font-weight: bold;
						margin-bottom: 30rpx;
						color:#000
					}
					.content {
						margin-bottom: 20rpx;
						.input-tip {
							color: #d4d4d4;
						}
					}
				}
			}
		}
	}
</style>
